/* 
 * File:   drv_uart.h
 * Author: Omar Sevilla
 *
 * Created on 24 de febrero de 2014, 10:20 AM
 */

#ifndef DRV_UART_H
#define	DRV_UART_H

#ifdef	__cplusplus
extern "C" {
#endif

#include "stdtypedef.h"
#include "system.h"

#define RX_NOT_INV              (0) //RX Polarity not inverted
#define TX_NOT_INV              (0) //TX Polarity not inverted
#define AUTO_BAUDRATE_DISABLE   (0) //Baud rate measurement disabled or completed
#define H_SPEED                 (1) //High Speed Config
    /*Defines for TXSTA*/
#define TX8_BIT                 (0 << 6) //Selects 8-bit transmission
#define TX_ENABLE               (1 << 5) //Transmit enabled
#define ASYNC_UART              (0 << 4) //Asynchronous Mode
#define SYNCB_COMPLETED         (0 << 3) //Sync Break transmission completed
/*Defines for RCSTA*/
#define SPEN_ENABLE             (1 << 7) //Serial port enabled (configures RX/DT and TX/CK pins as serial port pins)
#define RX8_BIT                 (0 << 6) //Selects 8-bit reception
#define CONT_RX                 (1 << 4) //Enables receiver


    extern void init_uart(T_UWORD baud_rate);
    extern T_UBYTE get_uart();
    extern void uart_send_char(T_UBYTE lub_Data);
    extern T_UBYTE uart_print(char lc_DataString[]);
    
#ifdef	__cplusplus
}
#endif

#endif	/* DRV_UART_H */

